package com.zcbl.toolkit.logger;

import com.zcbl.toolkit.http.request.RequestMetaData;

import java.util.Date;
import java.util.Objects;

public class SurveyCaseOperate {
    private Long id;

    private String userId;

    private String caseNo;

    private String interfaceUrl;

    private String clientIp;

    private String moduleType;

    private String operateDes;

    private Date createTime;

    private String remark;

    public SurveyCaseOperate() {
        RequestMetaData requestMetaData = SurveyBizDBLogger.getRequestMetaData();
        if (Objects.nonNull(requestMetaData)) {
            this.interfaceUrl = requestMetaData.getRequestUrl();
            this.clientIp = requestMetaData.getRemoteIp();
        }
    }

    public Long getId() {
        return id;
    }

    public SurveyCaseOperate setId(Long id) {
        this.id = id;
        return this;
    }

    public String getUserId() {
        return userId;
    }

    public SurveyCaseOperate setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
        return this;
    }

    public String getCaseNo() {
        return caseNo;
    }

    public SurveyCaseOperate setCaseNo(String caseNo) {
        this.caseNo = caseNo == null ? null : caseNo.trim();
        return this;
    }

    public String getInterfaceUrl() {
        return interfaceUrl;
    }

    public SurveyCaseOperate setInterfaceUrl(String interfaceUrl) {
        this.interfaceUrl = interfaceUrl == null ? null : interfaceUrl.trim();
        return this;
    }

    public String getClientIp() {
        return clientIp;
    }

    public SurveyCaseOperate setClientIp(String clientIp) {
        this.clientIp = clientIp == null ? null : clientIp.trim();
        return this;
    }

    public String getModuleType() {
        return moduleType;
    }

    public SurveyCaseOperate setModuleType(String moduleType) {
        this.moduleType = moduleType == null ? null : moduleType.trim();
        return this;
    }

    public String getOperateDes() {
        return operateDes;
    }

    public SurveyCaseOperate setOperateDes(String operateDes) {
        this.operateDes = operateDes == null ? null : operateDes.trim();
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public SurveyCaseOperate setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public SurveyCaseOperate setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
        return this;
    }

    @Override
    public String toString() {
        return "SurveyCaseOperate{" +
                "id=" + id +
                ", userId='" + userId + '\'' +
                ", caseNo='" + caseNo + '\'' +
                ", interfaceUrl='" + interfaceUrl + '\'' +
                ", clientIp='" + clientIp + '\'' +
                ", moduleType='" + moduleType + '\'' +
                ", operateDes='" + operateDes + '\'' +
                ", createTime=" + createTime +
                ", remark='" + remark + '\'' +
                '}';
    }
}